﻿using ClusteringProblem.Maths.Metrics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClusteringProblem.Maths
{
    public class DistanceMetricsFactory : IDistanceMetricsFactory
    {
        public IDistance CreateMetric(DistanceMetricsTypes dist)
        {
            IDistance distance;
            switch (dist)
            {
                case DistanceMetricsTypes.EuclideanDistance:
                    distance = new EuclideanDistance();
                    break;
                case DistanceMetricsTypes.ManhattanDistance:
                    distance = new ManhattanDistance();
                    break;
                case DistanceMetricsTypes.GowerDistance:
                    distance = new GowerDistance();
                    break;
                default:
                    distance = new CosineDistance();
                    break;
            }

            return distance;
        }
    }
}
